package com.etc.medical.feign;

import com.etc.common.entity.BasicDoctor;
import com.etc.common.utils.Result;
import com.etc.medical.client.LoginAndRegisterClient;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;

@RestController
@RequestMapping("/lr")
@CrossOrigin(origins = "*")
public class LoginAndRegisterFeign {
    @Resource
    private LoginAndRegisterClient lrClient;

    /**
     * 登录
     */
    @RequestMapping(value = "login", method = RequestMethod.POST)
    public Result login(@RequestParam String username, @RequestParam String password) {
        return lrClient.login(username, password);
    }

    /**
     * 注册
     */
    @RequestMapping(value = "register", method = RequestMethod.POST)
    public Result register(BasicDoctor doctor){
        return lrClient.register(doctor);
    }

    /**
     * 查询科室列表
     */
    @RequestMapping("/queryDp")
    public Result queryDepartmentList() {
        return lrClient.queryDepartmentList();
    }

    /**
     * 查询职位列表
     */
    @RequestMapping("/queryPs")
    public Result queryPositionList() {
        return lrClient.queryPositionList();
    }
}
